#ifndef WXSEVENTSEDITOR_H
#define WXSEVENTSEDITOR_H

#include "../properties/wxsproperties.h"
#include "../wxscodinglang.h"

class wxsItem;
class wxsEvents;
class wxsEventDesc;
class wxsItemResData;


class wxsEventsEditor {
  public:


    wxsEventsEditor();


    ~wxsEventsEditor();


    static wxsEventsEditor& Get();


    void BuildEvents( wxsItem* Item, wxsPropertyGridManager* Grid );


    void PGChanged( wxsItem* Item, wxsPropertyGridManager* Grid, wxPGId Id );


    bool GotoOrBuildEvent( wxsItem* Item, int EventIndex, wxsPropertyGridManager* Grid );

  private:


    WX_DEFINE_ARRAY( wxPGId, wxArrayPGId );

    wxsItemResData* m_Data;
    wxsItem* m_Item;
    wxsEvents* m_Events;
    wxString m_Source;
    wxString m_Header;
    wxString m_Class;
    wxsCodingLang m_Language;
    wxArrayPGId m_Ids;


    void FindFunctions( const wxString& ArgType, wxArrayString& Array );


    wxString GetNewFunction( const wxsEventDesc* Event );


    wxString GetFunctionProposition( const wxsEventDesc* Event );


    bool CreateNewFunction( const wxsEventDesc* Event, const wxString& NewFunctionName );


    bool GotoHandler( int EventIndex );
};

#endif
